﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WF.DAL;

namespace WF.Model
{
    /// <summary>
    /// DepartmentAdjustApply实体对象
    /// </summary>
    [Serializable]
    public class DepartmentAdjustApplyEntity : EntityBase<DAL.DepartmentAdjustApply>
    {
        #region 构造函数



        public DepartmentAdjustApplyEntity()
            : base()
        {
            this.DateMod = System.DateTime.Now;
            this.FlagStatus = "有效";
        }
        public DepartmentAdjustApplyEntity(DepartmentAdjustApply DepartmentAdjustApply) : base(DepartmentAdjustApply) { }
        #endregion

        #region 实现基类abstract属性


        public override string ID
        {
            get { return DbEntity.RowID; }
            set { DbEntity.RowID = value; this.SendPropertyChanged("RowID"); }
        }

        public override string DisplayName
        {
            get { return DbEntity.RowID; }
        }

        #endregion

        #region Public 属性



        public string DeptID
        {
            get
            {
                return DbEntity.DeptID;
            }
            set
            {
                DbEntity.DeptID = value;
                this.SendPropertyChanged("DeptID");
            }
        }

        public string DeptName
        {
            get { return DbEntity.DeptName; }
            set { DbEntity.DeptName = value; this.SendPropertyChanged("DeptName"); }
        }

        public string PreParentID
        {
            get
            {
                return DbEntity.PreParentID;
            }
            set
            {
                DbEntity.PreParentID = value;
                this.SendPropertyChanged("PreParentID");
            }
        }
        public string PreParentFullName
        {
            get
            {
                return DbEntity.PreParentFullName;
            }
            set
            {
                DbEntity.PreParentFullName = value;
                this.SendPropertyChanged("PreParentFullName");
            }
        }
        public string CurParentID
        {
            get
            {
                return DbEntity.CurParentID;
            }
            set
            {
                DbEntity.CurParentID = value;
                this.SendPropertyChanged("CurParentID");
            }
        }
        public string CurParentFullName
        {
            get
            {
                return DbEntity.CurParentFullName;
            }
            set
            {
                DbEntity.CurParentFullName = value;
                this.SendPropertyChanged("CurParentFullName");
            }
        }

        public System.DateTime DateBegin
        {
            get
            {
                return DbEntity.DateBegin;
            }
            set
            {
                DbEntity.DateBegin = value;
                this.SendPropertyChanged("DateBegin");
            }
        }
        public System.DateTime DateMod
        {
            get
            {
                return DbEntity.DateMod;
            }
            set
            {
                DbEntity.DateMod = value;
                this.SendPropertyChanged("DateMod");
            }
        }

        public short? FlagAudit
        {
            get
            {
                return DbEntity.FlagAudit;
            }
            set
            {
                DbEntity.FlagAudit = value;
                this.SendPropertyChanged("FlagAudit");
            }
        }

        public string AuditResult
        {
            get
            {
                if (DbEntity.FlagAudit == -1)
                {
                    return "拒绝";
                }
                else if (DbEntity.FlagAudit == 1)
                {
                    return "通过";
                }
                else
                {
                    return "未审核";
                }
            }
        }
        public string FlagStatus
        {
            get
            {
                return DbEntity.FlagStatus;
            }
            set
            {
                DbEntity.FlagStatus = value;
                this.SendPropertyChanged("FlagStatus");
            }
        }
        public string AdjustType
        {
            get { return DbEntity.AdjustType; }
            set { DbEntity.AdjustType = value; this.SendPropertyChanged("AdjustType"); }
        }
        public string AdjustDetail
        {
            get { return DbEntity.AdjustDetail; }
            set { DbEntity.AdjustDetail = value; this.SendPropertyChanged("AdjustDetail"); }
        }

        public string DeptKind
        {
            get { return DbEntity.DeptKind; }
            set { DbEntity.DeptKind = value; this.SendPropertyChanged("DeptKind"); }
        }


        public string Remark
        {
            get
            {
                return DbEntity.Remark;
            }
            set
            {
                DbEntity.Remark = value;
                this.SendPropertyChanged("Remark");
            }
        }

        public bool FlagMin
        {
            get
            {
                return DbEntity.FlagMin;
            }
            set
            {
                DbEntity.FlagMin = value;
                this.SendPropertyChanged("FlagMin");
            }
        }

        public short FlagDone
        {
            get
            {
                return DbEntity.FlagDone;
            }
            set
            {
                DbEntity.FlagDone = value;
                this.SendPropertyChanged("FlagDone");
            }
        }

        public string ApplicantID
        {
            get
            {
                return DbEntity.ApplicantID;
            }
            set
            {
                DbEntity.ApplicantID = value;
                this.SendPropertyChanged("ApplicantID");
            }
        }
        #endregion

        /// <summary>
        /// 从数据库对象创建逻辑对象
        /// </summary>
        /// <param name="linqDAL">数据库对象</param>
        /// <returns>逻辑对象</returns>
        [Obsolete("请使用 new DepartmentAdjustApplyEntity(linqDAL) ")]
        public static DepartmentAdjustApplyEntity CreateEntityFromDb(DepartmentAdjustApply linqDAL)
        {
            if (null == linqDAL) return null;
            DepartmentAdjustApplyEntity ret = new DepartmentAdjustApplyEntity(linqDAL);
            return ret;
        }

        //#region IEntity
        //public bool Add(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.Add(this);
        //}

        //public bool Update(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.Update(this);
        //}

        //public bool Delete(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.DeleteDepartmentAdjustApplyEntity(this.ID);
        //}

        //public bool GetDetail(WF.IDataLayer DataLayer)
        //{
        //    DepartmentAdjustApplyEntity result = null;
        //    if (!DataLayer.GetDepartmentAdjustApplyEntityById(this.ID, out result))
        //    {

        //        return false;
        //    }
        //    this._DALObject = result._DALObject;
        //    return true;
        //}
        //#endregion
    }
}
